package com.ldkj.panzh.controller;

import com.ldkj.panzh.domain.AjaxResult;
import com.ldkj.panzh.domain.TableDataInfo;
import com.ldkj.panzh.param.VehicleListParam;
import com.ldkj.panzh.service.VehicleListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 车辆名单查询 控制器（白名单/黑名单）
 *
 * @author qiancheng
 * @date 2025-11-19
 */
@Controller
public class VehicleListController extends BaseController {

    @Autowired
    VehicleListService vehicleListService;

    /**
     * 查询车辆白名单
     *
     * @param vehicleListParam 查询参数
     * @return 白名单列表
     * @throws Exception
     */
    @RequestMapping("/queryVehicleWhiteList")
    @ResponseBody
    public TableDataInfo queryVehicleWhiteList(@RequestBody VehicleListParam vehicleListParam) throws Exception {
        return getDataTable(vehicleListService.queryWhiteList(vehicleListParam));
    }

    /**
     * 查询车辆黑名单
     *
     * @param vehicleListParam 查询参数
     * @return 黑名单列表
     * @throws Exception
     */
    @RequestMapping("/queryVehicleBlackList")
    @ResponseBody
    public TableDataInfo queryVehicleBlackList(@RequestBody VehicleListParam vehicleListParam) throws Exception {
        return getDataTable(vehicleListService.queryBlackList(vehicleListParam));
    }

    /**
     * 查询白名单统计信息
     *
     * @param vehicleListParam 查询参数
     * @return 统计数据
     * @throws Exception
     */
    @RequestMapping("/queryVehicleWhiteListStats")
    @ResponseBody
    public AjaxResult queryVehicleWhiteListStats(@RequestBody VehicleListParam vehicleListParam) throws Exception {
        return success(vehicleListService.queryWhiteListStats(vehicleListParam));
    }

    /**
     * 查询黑名单统计信息
     *
     * @param vehicleListParam 查询参数
     * @return 统计数据
     * @throws Exception
     */
    @RequestMapping("/queryVehicleBlackListStats")
    @ResponseBody
    public AjaxResult queryVehicleBlackListStats(@RequestBody VehicleListParam vehicleListParam) throws Exception {
        return success(vehicleListService.queryBlackListStats(vehicleListParam));
    }
}
